﻿<!-- Copyright © LECO Corporation 2013.  All Rights Reserved. -->

<UserControl x:Class="CornerstoneRemoteControlClient.Views.TabLabelView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <TextBlock x:Name="TabLabel" Text="{Binding Label}" VerticalAlignment="Center" HorizontalAlignment="Center" TextAlignment="Center" Margin="0,10">
            <TextBlock.Style>
                <Style>
                    <Setter Property="TextBlock.FontWeight" Value="Bold"/>
                    <Setter Property="TextBlock.FontSize" Value="16"></Setter>
                    <Setter Property="TextBlock.TextWrapping" Value="Wrap"/>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding IsFlashing}" Value="True">
                            <DataTrigger.EnterActions>
                                <BeginStoryboard Name="FlashAnim">
                                    <Storyboard
                                        BeginTime="0:0:0"
                                        Duration="0:0:2"
                                        RepeatBehavior="Forever">
                                        <DoubleAnimationUsingKeyFrames
                                            BeginTime="00:00:00"
                                            Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame
                                                KeyTime="00:00:00"
                                                Value="1" />
                                            <SplineDoubleKeyFrame
                                                KeyTime="00:00:01.0"
                                                Value="0" />
                                            <SplineDoubleKeyFrame
                                                KeyTime="00:00:02.0"
                                                Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </DataTrigger.EnterActions>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding IsFlashing}" Value="False">
                            <DataTrigger.EnterActions>
                                <StopStoryboard BeginStoryboardName="FlashAnim">
                                </StopStoryboard>
                            </DataTrigger.EnterActions>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </TextBlock.Style>
        </TextBlock>
    </Grid>
</UserControl>
